﻿# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

if (MSVC)
  add_compile_options("/utf-8")
  add_compile_options(/w)  # 禁用所有警告
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  add_compile_options(-w)
endif ()


project ("OpenDGGS")

set(ISEXTRACT ON)


set(CMAKE_OUT_DIR ${CMAKE_SOURCE_DIR})
set(lib_output_directory ${CMAKE_OUT_DIR}/out)
set(lib_output_lib_directory ${lib_output_directory}/lib)
set(lib_output_bin_directory ${lib_output_directory}/bin)
set(lib_output_include_directory ${lib_output_directory}/include)
file(MAKE_DIRECTORY ${lib_output_lib_directory}/debug)
file(MAKE_DIRECTORY ${lib_output_bin_directory}/debug)
file(MAKE_DIRECTORY ${lib_output_lib_directory}/release)
file(MAKE_DIRECTORY ${lib_output_bin_directory}/release)
file(MAKE_DIRECTORY ${lib_output_include_directory})


# 包含子项目。
add_subdirectory("LibDGGSKernel")
add_subdirectory("LibDGGSField")
add_subdirectory("LibDGGSFeature")
add_subdirectory("LibGridTIFF")
add_subdirectory("DGGSUtility")
add_subdirectory("LibDGGSFieldPyramid")
add_subdirectory("DGGSViewer")
add_subdirectory("Example/cpp")
add_subdirectory("PyDGGS")
